package com.example.aicloud.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.aicloud.entity.Comment;
import com.example.aicloud.entity.vo.CommentVO;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


/**
 * (Comment)表数据库访问层
 *
 * @author makejava
 * @since 2024-07-14 20:08:01
 */
public interface CommentMapper extends BaseMapper<Comment> {
    @Select("SELECT c.*,u.username FROM `comment` c left join `user` u on u.uid=c.uid " +
            "where c.did=#{did} order by c.cid desc")
    List<CommentVO> getCommentList(@RequestParam("did") Long did);
}

